{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>评价管理</span>
            <span class="icon-angle-right"></span>
            <span>评价详情</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                            <tr>
                                <th colspan="4">查看评价详情</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="15%"><label>ID</label></td>
                                <td>{$info.id}</td>
                            </tr>
                            <tr>
                                <td width="15%"><label>评价人</label></td>
                                <td>{$info.nickname}</td>
                            </tr>
                            <tr>
                                <td width="15%"><label>评价级别</label></td>
                                <td>{$info.level_txt}</td>
                            </tr>
                            <tr>
                                <td width="15%"><label>评价时间</label></td>
                                <td>{$info.create_time}</td>
                            </tr>
                            <tr>
                                <td width="15%"><label>评价内容</label></td>
                                <td>{$info.content}</td>
                            </tr>
                            {if condition="$info['pics']"}
                            <tr>
                                <td width="15%"><label>图片</label></td>
                                <td>
                                    <div class="m-pic">
                                        <ul>
                                        {foreach name="$info['pics']" item="v"}
                                        <li><img src="{$v.attach_uri}" alt="" /></li>
                                        {/foreach}
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            {/if}
                            <tr>
                                <td width="15%"><label>状态</label></td>
                                <td><input type="checkbox" name="status" data-id="{$info.id}" lay-skin="switch" lay-filter="switch" lay-text="ON|OFF"{$info.status ? ' checked' : ''} /></td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<input type="hidden" name="redirect_uri" value="{:url('add', ['id' => $info.id])}" />
{/block}
{block name="extrajs"}
<script>
    $(function(){
        $('.m-order-action a').on('click', function(){
            var id              = $(this).parent().attr('data-id');
            var order_status    = $(this).attr('data-order-status');
            var pay_status      = $(this).attr('data-pay-status');
            var shipping_status = $(this).attr('data-shipping-status');
            var status = {
                id: id
            };
            if (typeof(order_status) !== "undefined") {
                status.order_status = order_status;
            }
            if (typeof(pay_status) !== "undefined") {
                status.pay_status = pay_status;
            }
            if (typeof(shipping_status) !== "undefined") {
                status.shipping_status = shipping_status;
            }
            //询问框
            layer.confirm('您确定要执行此操作吗？', {
                btn: ['确定', '取消']
            }, function(){
                $.post('{:url("orderAction")}', status, function(ret){
                    if (ret.status == 0) {
                        dialog.success(ret.message, function(){
                            window.location.reload();
                        });
                    } else {
                        dialog.error(ret.message);
                    }
                }, 'json');
            }, function(){
                
            });
        });
    })
</script>
{/block}